<%@ page contentType="text/html;charset=UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@page import="com.ufida.ebscg.comm.Constant"%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>招商银行供应商门户-采购创造价值</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="./javascript/aes/aes.js"></script>
<script type="text/javascript" src="./javascript/aes/md5.js"></script>
<script type="text/javascript" src="./javascript/aes/pad-zeropadding.js"></script>
<script type="text/javascript">

  function con_code(){
       document.getElementById("authimgid").src="authimg?num="+new Date();    
  }
  function regedit(){
	  window.location.href="regedit.jsp?backurl="+window.location.href; 
	  }
  function logon(){
  	   
  	   	var username = document.getElementsByName("username");
  	  	var passwd = document.getElementsByName("passwd");
  	    var authcode = document.getElementsByName("authcode");
  	  
  	  	var wd=document.getElementById("passwd").value;
  	  	var wds=document.getElementById("passwds").value;
  	  	var agress=document.getElementById("isAgree");
  	  	//document.regform.checkbox.checked == true
  	  	
  	  	if(username[0].value.replace(/(^\s*)|(\s*$)/g, "") == ""){
  	  		alert("请输入用户名!");
  	  		return;
  	  	}
  	  	
  	  	if(passwd[0].value.replace(/(^\s*)|(\s*$)/g, "") == ""){
  	  		alert("请输入密码!");
  	  		return;
  	  	}
  	  	
  	  	if(wd.length != 6){
  	  		alert("密码长度只能为6位");
  	  		return;
  	  	}
  	  	if(wd != wds){
  	  		alert("两次输入的密码不一致");
  	  		return;
  	  	}
  	  
  		if(authcode[0].value.replace(/(^\s*)|(\s*$)/g, "") == ""){
	  		alert("请输入验证码!");
	  		return;
	  	}
  	  	if(agress.checked != true){
  	  		alert("您还未接受招商银行供应商门户使用申明");
  	  		return;
  	  	}
  	   //为密码加密
  	   //document.getElementById("passwd").value = MD5(wd);
  	   
  	   var wdtmp=document.getElementById("passwd").value;
  	   document.getElementById("passwd").value = Encrypt(wdtmp);
  	   document.loginForm.submit();
  }
  function Encrypt(word){  
      var key = CryptoJS.enc.Utf8.parse("0102030405060708");   
      var iv  = CryptoJS.enc.Utf8.parse('0102030405060708');   
      var srcs = CryptoJS.enc.Utf8.parse(word);  
      var encrypted = CryptoJS.AES.encrypt(srcs, key, { iv: iv,mode:CryptoJS.mode.CBC});  
      //CryptoJS.AES.encrypt("Message", key, { iv: iv,mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.ZeroPadding});
      return encrypted.toString();  
 }
  function login()
  {
	  window.location.href="index.jsp"; 
  }
  
</script>

</head>

<body>
<!--页面头部开始-->
<div id="index_top">
	<div id="login_top" class="right_login">
		<span>已注册，现在就</span>
		<input type="button" onclick="login()" value="登录"  /></div></div>
<div id="index_right"></div>
<!--页面头部结束-->
<div align="center"><img onclick="logon()" width="80%"
	src="images/line.jpg" height="12" style="text-align: center" /></div>
<!--页面主体内容开始-->
<!--登录框开始-->
<div class="login"><html:form action="/regedit.do" method="post">
	<html:hidden property="action" value="regedit" />
	<div align="center" style="height: 15px;" class="f-12-F60000"><html:errors /></div>
	<center>
	<table border="0">
		<tr style="height: 65px;">
			<td align="right" style="font-size: 20px;">用户名：</td>
			<td colspan="3" align="left"><html:text
				style="height:26px;font-size:22px" property="username"></html:text></td>
			<td align="left"><font size="2" color="#666666">*建议使用组织机构代码</font></td>
		</tr>
		<tr style="height: 65px;">
			<td align="right" style="font-size: 20px;">密 码：</td>
			<td colspan="3" align="left"><html:password
				style="height:26px;font-size:22px" property="passwd"
				styleId="passwd"></html:password></td>
			<td align="left"><font size="2" color="#666666">*6个字符，区分大小写</font></td>
		</tr>
		<tr style="height: 65px;">
			<td align="right" style="font-size: 20px;">确认密码：</td>
			<td colspan="3" align="left"><html:password
				style="height:26px;font-size:22px" property="passwd"
				styleId="passwds"></html:password></td>
			<td align="left"><font size="2" color="#666666">*请再次填写密码</font></td>
		</tr>
		<tr style="height: 65px;">
			<td align="right" style="font-size: 20px;">验证码：</td>
			<td align="left"><html:text property="authcode"
				style="height:26px;width:80px;font-size:22px" /></td>
			<td><img id="authimgid" src="authimg" width="80" height="25" /></td>
			<td><font size="3" onclick="con_code()" style="cursor: hand;">换一张</font></td>
			<td></td>
		</tr>
		<tr style="height: 22px;">
			<td align="center" colspan="5"> <input type="checkbox"
				id="isAgree"><font size="3">已阅读并接受<a target="_blank" href="declaration.do">《招商银行供应商门户使用申明》</a></font>
			</input> </td>
		</tr>
		<tr style="height: 65px;">
			<td colspan="5"><!-- <input type="button" style="height:35px;width:200px;" value="立即注册"/> -->
			<img onclick="logon()" width="65%" src="images/reg_sub.jpg"
				height="80%" style="cursor: hand" />&nbsp;&nbsp; <!-- <img onclick = "regedit()"  src="images/regedit.jpg" width="54" height="27" style="cursor:hand"/> -->
			<!-- <img onclick = "cancel()"  src="images/index_meau_02.jpg" width="54" height="27" style="cursor:hand"/> -->
			</td>
		</tr>
	</table>
	</center>
	<input type="hidden" id="keyid" name="keyid" />
</html:form></div>
<!--登录框结束-->
<div class="text"></div>
<div class="clear"></div>


</div>
<br>
<!--页面主体内容结束-->
<div id="index_bottom"><font size="3">网站声明 | 友情链接 | 加入收藏夹</font></div>
<div id="footer"><font size="3">© 2009 招商银行 版权所有ICP许可证号
粤B2-20040497</font></div>

<%if(Constant.CAOPEN){ %>
<OBJECT id="CertSignAtl" codebase="<%=Constant.CAURL%>" height="0"
	hspace="0" width="0" align="center"
	classid="clsid:4FEA81CE-00EA-4FB2-850E-353C947B7A66" VIEWASTEXT>
</OBJECT>
<%} %>
</body>
</html>
